1. Field of the Invention
This invention relates to a page printer used with a computer system, etc., and in particular to control of the operation of storing image data in buffer memory, reading the image data from the buffer memory, and transferring the image data to a print engine.
The present application is based on Japanese Patent Applications No. Hei. 10-275074 and No. Hei. 11-97997, which are incorporated herein by reference.
2. Description of the Related Art
In a page printer, it is a general rule that the speed at which image data is expanded into a bit map and written into buffer memory differs from the speed at which image data is read from the buffer memory and is transferred to a print engine. Often, buffer memory has a small capacity and cannot store one page of image data. Thus, particularly for a complicated image of a large amount of data, image data expansion and write into the buffer memory is too late for the transfer timing to the print engine and an error in which data to be read from the buffer memory runs out during printing the page and the printing cannot be continued may occur (the error is referred to as an underrun error in the specification). In contrast, image data expansion and write into the buffer memory is too fast and the buffer memory becomes full, then an error in which the subsequent data cannot be written may occur (the error is referred to as an overrun error in the specification).
To solve this problem, in a page printer in Japanese Patent No. 2663861, a match between the buffer memory write address and read address is detected, whereby error occurrence is detected and the host is informed of the error occurrence, then informs the user of the error occurrence so that the user can take proper steps.
However, the advantage of the related art described above is only to inform the user of error occurrence when an error occurs for taking proper steps. For the user, it is ideal that no error occurs and print always succeeds. It is more desirable that if an error occurs, the system automatically takes proper steps for handling the error.
It is an object of the invention to prevent an overrun error from occurring.
It is another object of the invention to prevent an underrun error from occurring.
It is still another object of the invention to automatically take proper steps and retry printing, thereby causing the retried printing to succeed if an underrun error occurs.
According to a first aspect of the invention, there is provided a page printer comprising memory containing a buffer, an image output section for forming an image based on data and outputting the image, a reception section for writing data received from a host into the buffer, a transfer section for transferring the data in the buffer to the image output section, and a control section for controlling the reception section and the transfer section. The control section permits the transfer section to transfer the data in the buffer after at least a part as much as a predetermined amount P, of one page of data from the host is stored in the buffer. The predetermined amount P is equal to or less than the size of the buffer and is set so that the predicted point in time at which the transfer section will complete transferring of all of one page of data from the buffer becomes later than the predicted point in time at which the reception section will complete writing of all of the page of data into the buffer.
According to the page printer, the transfer start timing is controlled so that write of received data into the buffer always precedes transfer of the data from the buffer in the process of reception and transfer of one page of data, thus an underrun error is prevented.
Preferably, just before reception of each page is started, the predetermined amount P is determined so as to substantially satisfy the relation
Mxe2x89xa7P greater than T(xcex1xe2x88x92(x/y))
where x is predicted data reception speed from the host, y is predicted data transfer speed to the image output section, xcex1 is a predicted compression rate of data from the host, T is the total number of data pieces of one page, and M is the buffer size.
Preferably, the predetermined amount P is determined by the printer itself. Preferably, the host determines the predetermined amount P and specifies the amount for the printer. When the host determines the predetermined amount P, the predetermined amount P is easy to set appropriately because generally the CPU of the host is high performance.
Preferably, if the buffer has an available capacity reduced to a predetermined minimum amount even before data as much as the predetermined amount P is stored in the buffer, the printer spontaneously starts transferring the data in the buffer, whereby if the predetermined amount P is not appropriate, an event in which the buffer becomes full is avoided.
According to a second aspect of the invention, there is provided a page printer comprising memory containing a buffer, an image output section for forming an image based on data and outputting the image, a reception section for writing data received from a host into the buffer, a transfer section for transferring the data in the buffer to the image output section, and a control section for controlling the reception section and the transfer section. The control section permits the transfer section to transfer the data in the buffer at a predetermined start timing. The start timing is set variably in response to a parameter affecting an increase or decrease in the data in the buffer. For example, the parameters affecting an increase or decrease in the data in the buffer are predicted data reception speed from the host, predicted data transfer speed to the image output section, a predicted compression rate of data from the host, the total number of data pieces of one page, the buffer size, etc. The start timing can be set in response to at least one of the parameters. Alternatively, the start timing can be set in response to different information substantially corresponding to the predicted data reception speed from the host, for example, the communication port, communication mode, etc., used with communication between the host and the printer.
According to the page printer, appropriate start timing such that no underrun error occurs and that the buffer does not become full, for example, for each page can be set, for example, for each page.
Preferably, the start timing is applied when at least a part as much as a predetermined amount P, of one page of data from the host is stored in the buffer, and the predetermined amount P is set so as to substantially satisfy
Mxe2x89xa7P greater than T(xcex1xe2x88x92(x/y))
where x is predicted data reception speed from the host, y is predicted data transfer speed to the image output section, xcex1 is a predicted compression rate of data from the host, T is the total number of data pieces of one page, and M is the buffer size.
According to a third aspect of the invention, there is provided a page printer comprising memory containing a buffer; an image output section for forming an image based on data and outputting the image, a reception section for writing data received from a host into the buffer, a transfer section for transferring the data in the buffer to the image output section, an error detection section for detecting an underrun error caused by the fact that a read address of the transfer section from the buffer catches up with a write address of the reception section into the buffer, and an error notification section for notifying the host of occurrence of the underrun error. When the host is notified of underrun error occurrence from the page printer, it resends the data to the page printer under a condition where the underrun error is harder to occur.
When the underrun error occurs, the data is automatically resent under a condition where the underrun error is harder to occur (the process is repeated stepwise depending on the situation), whereby retry printing can be made to succeed as the data is resent without causing an underrun error to occur. Although the print image quality is somewhat degraded by dropping the resolution, print can be reliably made to succeed without troubling the user.
The condition where the underrun error is harder to occur is, for example, to delay the current transfer start timing of the data in the buffer by the transfer section or to make the current data resolution lower. Preferably, when an underrun error occurs, first the transfer start timing of the data in the buffer by the transfer section is set to a later timing and the data is resent. If an underrun error occurs still after the start timing is delayed, then the resolution is lowered and the data with the resolution lowered is resent.
Preferably, when detecting an underrun error, the printer temporarily stores occurrence information of the underrun error in the memory without immediately notifying the host of the underrun error. Upon reception of a request from the host, the printer transmits the underrun error occurrence information to the host. The host requests the printer to send error information at printer""s convenience, for example, each time the host attempts to transmit one-band data. This method enables host processing to be simplified as compared with the method wherein the host is informed of an underrun error immediately when the underrun error is detected.
According to a fourth aspect of the invention, there is provided a page printer comprising memory containing a buffer, an image output section for forming an image based on data and outputting the image, a reception section for writing data received from a host into the buffer, a transfer section for transferring the data in the buffer to the image output section, and an available buffer capacity notification section for notifying the host of information concerning the available capacity of the buffer. The host transmits data of a size that can be received at the printer to the printer based on the notification from the page printer, whereby an overrun error is prevented.
Preferably, the host sends data compressed in predetermined units, for example, band units or data not compressed to the printer and gets the available buffer capacity from the printer just before transmission of each band data is started. If the available buffer capacity is equal to or larger than the size of the band data, the host starts transmitting the band data; if the available buffer capacity is less than the size of the band data, the host waits until the available buffer capacity becomes equal to or larger than the size of the band data before the host starts transmitting the band data.
Preferably, the page printer further has a function of detecting a printer error such as an underrun error and various types of printer status such as print success of each page. In this case, the printer once stores information of the detection result in the memory and transmits the information in the memory upon reception of a request from the host. Just before the host attempts to start transmitting each band data, it sends a request to the printer for getting the printer status.
According to a fifth aspect of the invention, there is provided a page printer comprising memory containing a buffer, an image output section for forming an image based on data and outputting the image, a reception DMA section for receiving data in a reception data size unit from a host and writing the data into the buffer by DMA, a transfer DMA section for transferring the data in the buffer to the image output section in a transfer data unit by DMA, and a control section for controlling the reception DMA section and the transfer DMA section. Here, the reception data size unit is the same as the transfer data size unit, for example, one band. The control section checks whether or not an underrun error occurs based on the transfer DMA start address of the transfer DMA section and the current reception DMA address of the reception DMA section whenever the transfer DMA section attempts to start data transfer in the transfer data size unit. If the underrun error is detected, the control section notifies the host of occurrence of the underrun error.
Thus, the presence or absence of an underrun error is detected at an appropriate timing not too frequent and the host can be notified of the underrun error if the error occurs.
Preferably, when detecting an underrun error, the printer once stores information concerning the underrun error in the memory and sends the information to the host upon reception of a request from the host. Just before the host attempts to start transmitting data in each reception data size unit, for example, each band, it sends a request to the printer for getting the error information.
The host of the invention typically is a computer and a computer program for use with the host (computer), for example, a printer driver program can be installed in or loaded into the computer through various media such as disk-type storage, semiconductor memory, and a communication network.